﻿using System;
using UnityEngine;

namespace Valve.VR.InteractionSystem
{
	// Token: 0x02000628 RID: 1576
	public class SoundPlayOneshot : MonoBehaviour
	{
		// Token: 0x060027D7 RID: 10199 RVA: 0x000E7FAC File Offset: 0x000E61AC
		private void Awake()
		{
			this.thisAudioSource = base.GetComponent<AudioSource>();
			if (this.playOnAwake)
			{
				this.Play();
			}
		}

		// Token: 0x060027D8 RID: 10200 RVA: 0x000E7FCC File Offset: 0x000E61CC
		public void Play()
		{
			if (this.thisAudioSource != null && this.thisAudioSource.isActiveAndEnabled && !Util.IsNullOrEmpty<AudioClip>(this.waveFiles))
			{
				this.thisAudioSource.volume = UnityEngine.Random.Range(this.volMin, this.volMax);
				this.thisAudioSource.pitch = UnityEngine.Random.Range(this.pitchMin, this.pitchMax);
				this.thisAudioSource.PlayOneShot(this.waveFiles[UnityEngine.Random.Range(0, this.waveFiles.Length)]);
			}
		}

		// Token: 0x060027D9 RID: 10201 RVA: 0x000E8064 File Offset: 0x000E6264
		public void Pause()
		{
			if (this.thisAudioSource != null)
			{
				this.thisAudioSource.Pause();
			}
		}

		// Token: 0x060027DA RID: 10202 RVA: 0x000E8084 File Offset: 0x000E6284
		public void UnPause()
		{
			if (this.thisAudioSource != null)
			{
				this.thisAudioSource.UnPause();
			}
		}

		// Token: 0x040027DB RID: 10203
		public AudioClip[] waveFiles;

		// Token: 0x040027DC RID: 10204
		private AudioSource thisAudioSource;

		// Token: 0x040027DD RID: 10205
		public float volMin;

		// Token: 0x040027DE RID: 10206
		public float volMax;

		// Token: 0x040027DF RID: 10207
		public float pitchMin;

		// Token: 0x040027E0 RID: 10208
		public float pitchMax;

		// Token: 0x040027E1 RID: 10209
		public bool playOnAwake;
	}
}
